<script>
  const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))

  const game = async () => {
    console.log('游戏开始')
    try {
      await sleep(500)
      console.log('游戏进行中')
      await sleep(1000)
      console.log('游戏进行中')
      await sleep(1000)
      console.log('游戏进行中')
      await sleep(1000)
      console.log('游戏结束')
    } catch (error) {
      console.error('游戏出错:', error)
    }
  }

  game()
</script>
